import { http } from "@/utils/http/axios";

// 查询字典类型
export function getPageList(params = {}) {
	return http.request<API.Response.BasicResponse>(
		{
			url: "/system/dict/type/list",
			method: "get",
			params
		},
		{
			isTransformResponse: true
		}
	);
}

/**
 * 根据ID查询字典类型
 * @param id
 * @returns
 */
export function getDictType(id: any) {
	return http.request<API.Response.BasicResponse>(
		{
			url: "/system/dict/type/" + id,
			method: "get"
		},
		{
			isTransformResponse: true
		}
	);
}
/**
 * 添加字典类型
 * @returns
 */
export function save(params = {}) {
	return http.request<API.Response.BasicResponse>(
		{
			url: "/system/dict/type",
			method: "POST",
			data: params
		},
		{
			isTransformResponse: false
		}
	);
}
/**
 * 更新字典类型
 * @returns
 */
export function update(params = {}) {
	return http.request<API.Response.BasicResponse>(
		{
			url: "/system/dict/type",
			method: "PUT",
			data: params
		},
		{
			isTransformResponse: false
		}
	);
}
/**
 * 删除字典类型
 * @returns
 */
export function remove(id: number | Array<number>) {
	return http.request<API.Response.BasicResponse>(
		{
			url: "/system/dict/type/" + id,
			method: "DELETE"
		},
		{
			isTransformResponse: false
		}
	);
}
